perm filename TAKGJC.5[TIM,LSP] blob
sn#643416 filedate 1982-02-23 generic text, type C, neo UTF8
COMMENT ⊗ VALID 00002 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 (defmacro time←mark ()
C00004 ENDMK
C⊗;
(defmacro time←mark ()
#+LISPM '(time)
#+franz '(ptime)
#+NIL '(runtime)
#+Maclisp '(runtime))
(defun tak←test ()
(let ((tt (time←mark)))
(tak 18. 12. 6.)
(list (time←mark) tt)))
(defun takf←test ()
(let ((tt (time←mark)))
(takf 18. 12. 6.)
(list (time←mark) tt)))
(defun tak (x y z)
(if (not (< y x))
z
(tak (tak (1- x) y z)
(tak (1- y) z x)
(tak (1- z) x y))))
(defun takf (x y z)
(takfsub #'takfsub x y z))
#-NIL
(defun takfsub (f x y z)
(if (not (< y x))
z
(funcall f f (funcall f f (1- x) y z)
(funcall f f (1- y) z x)
(funcall f f (1- z) x y))))
#+NIL
(defun takfsub ((&function f) x y z)
;; lexical scoping of function bindings allows this.
(if (not (< y x))
z
(f #'f (f #'f (1- x) y z)
(f #'f (1- y) z x)
(f #'f (1- z) x y))))